import Control.Monad

growth :: [Int]
growth = 1 : [if g `mod` 2 == 0 then g+1 else g*2 | g <- growth]

height :: Int -> Int
height n = last $ take (n + 1) growth

main = do
    q <- readLn
    xs <- replicateM q getLine
    mapM_ (putStrLn . show . height . read) xs